// 审核权限判断

import { auditUserAuth } from "@/request/system"
import { useEffect, useState } from "react"
import { useLocation  } from "react-router-dom";

export default function useAuditUserAuth () {
    const [isAudit, setIsAudit] = useState(true)
    const location = useLocation()
    const bizCode = {
        "/finance/settlement/ratio": "SH00006",// 结算比列配置
        "/channel-merchant": "SH00006", // 渠道商管理
        "/merchant/merchant-info": "SH00006", // 商家管理
        "/yee/finance/settlement/ratio": "SH00006",// 结算比列配置--邑支付
        "/yee/merchant/merchant-info": "SH00006", // 商家管理--邑支付
    }

    const getData = async () => {
        auditUserAuth({
            auditUserId: "",
            bizCode: bizCode[location.pathname]
        }).then(res => {
            if (res.code === 200) {
                setIsAudit(res.data)
            }
        })
    }
    useEffect( () => {
        // getData()
    }, [] )
    return isAudit
}